/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import com.xy.biz.ts.domain.po.LearnRecordPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.LearnRecordBO;
import com.xy.biz.ts.domain.query.LearnRecordQuery;
import com.xy.biz.ts.domain.converter.LearnRecordConverter;
import com.xy.biz.ts.manager.LearnRecordManager;
import com.xy.biz.ts.dao.LearnRecordDao;

/**
 *
 *
 * @author yzh
 * @date 2021-3-29
 */
@Service
public class LearnRecordManagerImpl implements LearnRecordManager {

    @Autowired
    private LearnRecordDao learnRecordDao;

    @Override
    public int saveLearnRecord(LearnRecordBO learnRecordBO) {
        return learnRecordDao.saveLearnRecord(LearnRecordConverter.toPO(learnRecordBO));
    }

    @Override
    public int saveAllLearnRecord(Collection<LearnRecordBO> collection) {
        return learnRecordDao.saveAllLearnRecord(LearnRecordConverter.toPO(collection));
    }

    @Override
    public int updateLearnRecord(LearnRecordBO learnRecordBO) {
        return learnRecordDao.updateLearnRecord(LearnRecordConverter.toPO(learnRecordBO));
    }

    @Override
    public int deleteLearnRecord(Long learnRecordId) {
        return learnRecordDao.deleteLearnRecord(learnRecordId);
    }

    @Override
    public LearnRecordBO getLearnRecord(Long learnRecordId) {
        return LearnRecordConverter.fromPO(learnRecordDao.getLearnRecord(learnRecordId));
    }

    @Override
    public List<LearnRecordBO> listLearnRecordById(Collection<Long> collection) {
        return LearnRecordConverter.fromPO(learnRecordDao.listLearnRecordById(collection));
    }

    @Override
    public List<LearnRecordBO> listLearnRecord(LearnRecordQuery query) {
        return LearnRecordConverter.fromPO(learnRecordDao.listLearnRecord(query));
    }

    @Override
    public int countLearnRecord(LearnRecordQuery query) {
        return learnRecordDao.countLearnRecord(query);
    }
}
